<template>
  <div>
    <el-row :gutter="15">
      <el-form ref="sshValue" :model="sshFormData" :rules="rules1" size="medium" label-width="100px">
        <el-col :span="6">
          <el-form-item label="ssh来源" prop="username">
            <el-input v-model="sshFormData.username" placeholder="请输入ssh来源" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="20">
          <el-form-item label="ssh公钥" prop="value">
            <el-input v-model="sshFormData.value" type="textarea" placeholder="请输入ssh公钥"
              :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item size="large">
            <el-button type="primary" @click="submitSshForm">提交</el-button>
            <el-button @click="resetSshForm">重置</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      sshFormData: {
        username: undefined,
        value: undefined,
      },
      rules1: {
        username: [{
          required: true,
          message: '请输入ssh来源',
          trigger: 'blur'
        }],
        value: [{
          required: true,
          message: '请输入ssh公钥',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitSshForm() {
      this.$refs['sshValue'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetSshForm() {
      this.$refs['sshValue'].resetFields()
    },
  }
}

</script>
<style>
</style>
